<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="tutorial.css">
<TITLE>
Introduction
</TITLE>
</HEAD>
<BODY >
<A HREF="tutorial001.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="tutorial003.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H1 CLASS="chapter"><A NAME="htoc1">Chapter&nbsp;1</A>&nbsp;&nbsp;Introduction</H1><UL>
<LI><A HREF="tutorial002.html#toc1">Intended audience</A>
<LI><A HREF="tutorial002.html#toc2">Related work</A>
<LI><A HREF="tutorial002.html#toc3">Structure of tutorial</A>
</UL>

<A NAME="introduction"></A>
This tutorial is an introduction to the design, development, test and maintenance of large scale applications with the ECLiPSe system. It follows a top-down methodology of converting an initial high-level specification into executable code of high quality. We assume that fundamental decisions on selecting the right tool and the right problem solver have already been taken so that we are commited to using ECLiPSe and one of its problem solving libraries. We are basically interested in the engineering aspects of the program development, not its research and development content.<BR>
<BR>
At the same time we provide a number of programming concepts, standard templates that can be used for many ECLiPSe programming tasks. A knowledge of these concepts helps the programmer not only to understand existing code more rapidly, but also should lead to standard solutions whenever a new problem has to be solved.<BR>
<BR>
The tutorial uses excerpts from one of applications developed by Parc Technologies to highlight some of the design choices and also to provide code examples taken from real-life components. This application is centered on IP network analysis, so devices like routers and interfaces will occur throughout the example code. A detailed understanding of the application domain should not be required to understand and re-use the examples.<BR>
<BR>
<A NAME="toc1"></A>
<H2 CLASS="section"><A NAME="htoc2">1.1</A>&nbsp;&nbsp;Intended audience</H2>
The tutorial is aimed at programmers learning how to develop applications with ECLiPSe and tries to codify a 'best practice'<A NAME="@default0"></A> for developers. It assumes a basic familarity with concepts of constraint and logic programming and is not a reference manual, so many concepts and language elements are only introduced very briefly. The material also includes some general topics from software engineering. Knowledge of general OO-related methodologies may be helpful to put that material into context.<BR>
<BR>
The tutorial should not only benefit the designers and developers of ECLiPSe applications, but also those who maintain existing systems. It explains a number of typical design patterns in ECLiPSe programs, and also discusses how to isolate problems and how to make small, incremental changes to a design.<BR>
<BR>
<A NAME="toc2"></A>
<H2 CLASS="section"><A NAME="htoc3">1.2</A>&nbsp;&nbsp;Related work</H2>
Most of the existing textbooks on logic programming carefully describe all language features, but do not provide information how to use these features to obtain particular objectives or how to develop complete systems that can be maintained and extended easily. <BR>
<BR>
The methodology developed in the CHIC-II project <A NAME="@default1"></A> looks at a much wider methodology question (http://www.icparc.ic.ac.uk/chic2/methodology/)<A NAME="@default2"></A>. It not only covers problems like how to select a problem solving technology to fit a particular problem, but also discusses project related issues like team composition<A NAME="@default3"></A>, rapid prototyping<A NAME="@default4"></A> and development of problem specifications. On the other hand, it does not discuss the details of developing an ECLiPSe application once the main design choices have been taken.<BR>
<BR>
The book &#8220;The Craft of Prolog&#8221; by Richard O'Keefe is an invaluable source for writing efficient Prolog programs. Many of the techniques and tricks presented are also applicable to writing efficient ECLiPSe programs. The underlying maxim &#8220;elegance is not optional&#8221; summarizes the spirit of declarative programming. As the book is based on a standard Edinburgh style Prolog, it does not handle issues of module structure and in-line documentation, nor other ECLiPSe specific features.<BR>
<BR>
The ECLiPSe documentation contains most of the information provided in this tutorial, but presents it in a very different way. Invariably, it describes all features of the system, many of which are only required for quite specific (if important) tasks like developing new constraint engines inside the system. It can be difficult to find which parts of the documentation contains important hints to solve a particular problem. On the other hand, it will be useful to look up each feature in the user manual and/or the reference manual as they occur in the tutorial.<BR>
<BR>
The software engineering techniques used in this tutorial are mainly adaptations of OO-development methodologies. This field is far too wide to give specific references here, but the excellent Object Technology Series (http://www.awl.com/cseng/otseries) is a good starting point.<BR>
<BR>
<A NAME="toc3"></A>
<H2 CLASS="section"><A NAME="htoc4">1.3</A>&nbsp;&nbsp;Structure of tutorial</H2>
The tutorial follows a top-down methodology for the design of an application. Chapter&nbsp;<A HREF="tutorial003.html#highleveldesign">2</A> discusses general issues of modular design and self-documenting code for ECLiPSe programs. The next chapter on data structures compares different ways of representing data internally and externally, and presents a canonical multi-representation format which allows effective access to data in all parts of an application. Chapter&nbsp;<A HREF="tutorial005.html#gettingittowork">4</A> shows how to convert a high level specification into an executable program early in the development stage. The bulk of the tutorial is contained in chapter&nbsp;<A HREF="tutorial006.html#programmingconcepts">5</A>, where we present a number of different programming concepts which can be used as development templates to solve particular problems. This is followed by chapter&nbsp;<A HREF="tutorial007.html#inputoutput">6</A> on input/output, a particularly important aspect of developing extensible programs. The last two chapters deal with debugging (chapter&nbsp;<A HREF="tutorial008.html#ifitdoesntwork">7</A>) and testing (chapter&nbsp;<A HREF="tutorial009.html#correctnessandperformance">8</A>).<BR>
<BR>
There are three appendices to the tutorial. The first one summarizes style rules that good ECLiPSe programs should satisfy. Most of the rules are explained inside the main tutorial text, they are presented here for easy reference. Appendix&nbsp;<A HREF="tutorial011.html#layoutrules">B</A> gives some rules how ECLiPSe programs should be indented. The last section (appendix&nbsp;<A HREF="tutorial012.html#corepredicates">C</A>) lists core ECLiPSe predicates which should cover most programming needs and which all ECLiPSe programmers should be familiar with.<BR>
<BR>
<HR>
<A HREF="tutorial001.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="tutorial003.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
